package com.huawei.classroom.student.h04;

public class MyStack {
	int size;
	int num=0;
	int[] s;
	public MyStack(int size) {
		this.size=size;
		this.s=new int[size];
	}
	
	public boolean isEmpty() {
		if(num==0)
			return true;
		return false;
	}
	
	public boolean isFull() {
		if(num==size)
			return true;
		return false;
	}
	
	public void push(int e) {
		if(num==size) return;
		this.num++;
		this.s[num-1]=e;
	}
	
	public int pop() {
		int t=this.s[num-1];
		this.s[num-1]=0;
		this.num--;
		return t;
	}
}
